1. Field of the Invention
This invention relates in general to the fields of Computer Operating Systems, Multi-processor Hardware Systems, Object Oriented Programming, and Virtual Memory Systems. In particular, the invention relates to improved techniques for establishing and handling trusted connections and relationships between a virtual memory manager ("VMM") and a supporting pager or file system ("pager"), and to improved methods of virtual memory management using objects.
2. Background Art
As computer systems have evolved, the need to manage scarce hardware resources such as memory, has led to the development of virtual memory management techniques.
Virtual memory management arrangements generally involve a relatively small capacity semiconductor memory which is fast (called "main" memory or "real" memory), and a relatively large capacity storage device, such as a disk drive, which is inexpensive but slow (sometimes called the "backing store"). The small capacity memory is made to appear larger to the system by means of a paging mechanism which transfers data between the two separate storage entities so that the information required by the system is readily available in real memory. The transfer of data is referred to as "paging", in that the data is transferred in blocks or "pages", each of which is generally a fixed size, such as 4096 (4k) bytes, by a paging mechanism (or paging subsystem).
The paging mechanism causes a page of data to be paged into real memory in response to the occurrence of a page fault. A page hull occurs when the system requests data that is not in real memory. The page fault mechanism determines that the requested data is not in real memory, and initiates the paging operation. A page fault causes the program that is being executed, often referred to as a "process" or "thread", to be halted until the page fault is resolved by paging in the required data.
The part of the operating system which handles the paging in and out process is generally called the memory management subsystem. The memory management subsystem keeps track of what pages are in main memory, and how the real memory addresses of these pages relate to the virtual memory addresses of the user program. This is generally done through a series of related tables of data which relate the user's virtual address to a "page" number, the page number to a physical memory area called a page "frame", and the page frame to the physical memory area that contains the user's data. Other data is also maintained in these tables such as bits indicating whether processes can read, write or execute from the page, as well as other bits to support the demand paging operation itself. For example, such bits are used to indicate whether the contents of the page are "valid"; whether a process recently "referenced" a page; whether a process or thread "modified" a page; whether the operating system must create a new copy of the page when a process or thread modifies its contents (called a "copy-on-write" bit); and finally there may be "age" bits maintained by the system to indicate how long the page has been in main memory. As user processes or threads are activated and deactivated, and the related pages of data moved into and out of main memory, these tables are constantly changing and thus are dynamically maintained by the memory management system. This process is generally referred to as the "memory mapping" or "maintaining memory mappings" process.
This entire virtual memory management process can be implemented in software but frequently parts of the process are implemented in hardware. For example, in the prior art, some hardware systems implement some parts of this process, either as a separate semiconductor chip or on the same chip as the CPU, such as 1) performing the address translation from the virtual address of the running process or thread to the physical address in main memory, 2) providing memory protection so a process or thread cannot read or write the address space of another, and 3) signaling a page fault if a memory reference occurs to a page not currently resident. This unit is often called the Memory Management Unit ("MMU").
Many well known systems in the prior art implement virtual memory techniques including VMS.RTM., MACH.TM., SunOS.TM., and the UNIX.RTM. Operating System. (VMS is a registered trademark of Digital Equipment Corporation; MACH is a trademark of Carnegie Mellon University; SunOS is a trademark of Sun Microsystems, Inc. (the assignee of the present invention), and UNIX is a registered trademark in the United States and other countries and is exclusively licensed by X/OPEN Company Ltd.
MACH presently implements virtual memory techniques in an object oriented system. In MACH, the use of a memory object to both encapsulate the mapping and attributes of a memory space and to control the communications to the memory cache object and the related paging operations can result in an inefficient use of the physical memory space used by the cache as well as related unnecessary paging operations where two or more programs or tasks or processes or threads (hereinafter "programs") are using the same memory space. These inefficiencies result from the fact that the MACH memory object creates a separate related memory cache object each time a new memory object is called, without regard for the possibility that the same data is already being paged by another memory object-memory cache object pair. Moreover, the existing MACH implementation of memory objects contains no authentication procedures to insure that a Virtual Memory Manager ("VMM") which requests a paging of data has the authorization to do so. The prior art MACH documentation suggests the possibility of constructing a "mapping server" as a third party trusted component to handle the problem of untrustworthy clients and untrustworthy servers by using a "mapping token port". The suggested mapping server is similarly inefficient as it requires an unnecessary additional server to be implemented. The development of object oriented versions of such operating systems for tightly-coupled multiprocessor systems, as well as distributed shared memory systems of heterogeneous types of computer hardware, wherein virtual memory management functions are exported to user domains and wherein programs may pass memory object handles around from client to client, makes it essential that methods to authenticate and control requests for access to common paged data areas are used.
The present invention provides a method and apparatus for improving the efficiency of paged data space usage and correspondingly reducing the processing time needed to support paged data operations by allowing memory objects to share the same pages of data even though each memory object may have different access rights to the data. This is done by separating the functionality of encapsulating the representation of memory space and the values representing the memory attributes of length and access rights, from the functionality of accessing the data contained in the memory space represented by the values encapsulated in the memory object. In addition the present invention provides a method and apparatus for supporting a new and unique protocol for establishing authenticated connections between a local node's VMM and a supporting pager.